package com.cssy.yd.basic.dao.impl;

import java.util.List;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.yd.basic.dao.BasicStorageinfoTypeDAO;
import com.cssy.yd.basic.entity.BasicStorageinfoDO;
import com.cssy.yd.basic.entity.BasicStorageinfoTypeDO;
import com.plat.helper.SearchConditions;

/**
 * ��ݷ��ʶ���ʵ����
 * @since 2013-06-19
 */
public class BasicStorageinfoTypeDAOImpl extends SqlMapClientDaoSupport implements BasicStorageinfoTypeDAO {

    /**
     * �������
     * @param basicStorageinfoTypeDO
     * @return ������ݵ�����
     */
    public String insertBasicStorageinfoTypeDO(BasicStorageinfoTypeDO basicStorageinfoTypeDO) throws DataAccessException {
        Object id = getSqlMapClientTemplate().insert("BasicStorageinfoType.insert", basicStorageinfoTypeDO);
        return (String) id;
    }

    /**
     * ͳ�Ƽ�¼��
     * @param basicStorageinfoTypeDO
     * @return ����ļ�¼��
     */
    public Integer countBasicStorageinfoTypeDOByExample(BasicStorageinfoTypeDO basicStorageinfoTypeDO) throws DataAccessException {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("BasicStorageinfoType.countByDOExample", basicStorageinfoTypeDO);
        return count;
    }

    /**
     * ���¼�¼
     * @param basicStorageinfoTypeDO
     * @return ��Ӱ�������
     */
    public Integer updateBasicStorageinfoTypeDO(BasicStorageinfoTypeDO basicStorageinfoTypeDO) throws DataAccessException {
        int result = getSqlMapClientTemplate().update("BasicStorageinfoType.update", basicStorageinfoTypeDO);
        return result;
    }

    /**
     * ��ȡ�����б�
     * @param basicStorageinfoTypeDO
     * @return �����б�
     */
    @SuppressWarnings("unchecked")
    public List<BasicStorageinfoTypeDO> findListByExample(BasicStorageinfoTypeDO basicStorageinfoTypeDO) throws DataAccessException {
        List<BasicStorageinfoTypeDO> list = getSqlMapClientTemplate().queryForList("BasicStorageinfoType.findListByDO", basicStorageinfoTypeDO);
        return list;
    }

    /**
     * ��������ȡbasicStorageinfoTypeDO
     * @param id
     * @return basicStorageinfoTypeDO
     */
    public BasicStorageinfoTypeDO findBasicStorageinfoTypeDOByPrimaryKey(String id) throws DataAccessException {
        BasicStorageinfoTypeDO basicStorageinfoTypeDO = (BasicStorageinfoTypeDO) getSqlMapClientTemplate().queryForObject("BasicStorageinfoType.findByPrimaryKey", id);
        return basicStorageinfoTypeDO;
    }

    /**
     * ɾ���¼
     * @param id
     * @return ��Ӱ�������
     */
    public Integer deleteBasicStorageinfoTypeDOByPrimaryKey(String id) throws DataAccessException {
        Integer rows = (Integer) getSqlMapClientTemplate().delete("BasicStorageinfoType_ex.deleteById", id);
        return rows;
    }

	@Override
	public List<BasicStorageinfoTypeDO> find(SearchConditions scs)
			throws DataAccessException {
		List<BasicStorageinfoTypeDO> list = getSqlMapClientTemplate().queryForList("BasicStorageinfoType_ex.find", scs);
		return list;
	}

	@Override
	public Integer count(SearchConditions scs) throws DataAccessException {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("BasicStorageinfoType_ex.count", scs);
		return count;
	}

}